import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-01-31
 * Time: 21:26
 */
public class Test {

    public static void main(String[] args) {
        //计算5的阶乘
        int ret = 1;
        int i = 1;
        while (i<=5) {
            ret*=i;
            i++;
        }

        System.out.println(ret);

    }

    public static void main5(String[] args) {
        int i = 1;
        int j = 1;
        int k = 0;
        int sum = 0;
        int sum1 = 0;
        int sum2 = 0;
        //1+2+3...+100
        while (i <= 100) {
            sum += i;
            i++;
        }
        System.out.println(sum);
        //1~100奇数和
        while (j < 100) {
            sum1 += j;
            j += 2;
        }
        System.out.println(sum1);

        //1~100偶数和
        while (k <= 100) {
            sum2 += k;
            k += 2;
        }
        System.out.println(sum2);
    }

    public static void main4(String[] args) {
        char a = 0;
        //switch参数不能是long,boolean,float,double类型
        switch (a){
            case 1:
                System.out.println("one");
                break;
            case 2:
                System.out.println("two");
                break;
            default:
                System.out.println("nothing");
                break;
        }

        String str = "hello";
        switch (str){
            case "1":
                System.out.println("1");
                break;
            case "hello":
                System.out.println("hello");
                break;
            default:
                System.out.println("0");
                break;
        }

    }

    public static void main3(String[] args) {

        //乘法口诀表java版
        for (int i = 1; i <= 9; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j+"*"+i+"="+(i*j)+" ");
            }
            System.out.println();
        }
    }

    public static void main2(String[] args) {
        int a = 10;
        if(a%2 == 0) {
            System.out.println("偶数");
        } else {
            System.out.println("奇数");
        }
    }

    public static void main1(String[] args) {
        //java中的输入(从键盘):Scanner
        //Scanner scanner = new Scanner(System.in);
        //int a = scanner.nextInt();
        System.out.println("请输入年份:");
        int year = 0;
        Scanner scanner = new Scanner(System.in);
        year = scanner.nextInt();
        if((year % 100 != 0 && year % 4 ==0)||year % 400 ==0) {
            System.out.println(year+"是闰年");
        }

    }



}
